<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="王劲翔">
    <title>Document</title>
</head>

<body>
    <script>
        function getSum(arr) {
            return arr.reduce((sum, item) => sum += item, 0)
        }
        let arr2 = [3, 9, 9, 2, 7, 5]
        let sum2 = getSum(arr2)
        // console.log(`原数组为：${arr2}`);
        // console.log(`求得和为：${sum2}`);
    </script>
</body>

</html>